package com.example.demo.leetcode100题;

/**
 * @author：zzc
 * @date: 2022/9/4
 */
public class TreeNode {

    int val;
    TreeNode left;
    TreeNode right;

    public TreeNode() {

    }



    public TreeNode(TreeNode left, TreeNode right) {
        this.left = left;
        this.right = right;
    }

    public TreeNode(int val) {
        this.val = val;
    }

    public TreeNode(int val, TreeNode left, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }


    public TreeNode(Integer integer) {
    }

    public TreeNode addLeft(TreeNode left) {
        this.left = left;
        return this;
    }

    public TreeNode addRight(TreeNode right) {
        this.right = right;
        return this;
    }

    @Override
    public String toString() {
        return "TreeNode{" +
            "val=" + val +
            ", left=" + left +
            ", right=" + right +
            '}';
    }
}
